/*
 Licensed to Cloudera, Inc. under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  Cloudera, Inc. licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
@import (reference) "cui/colors.less";
@import (reference) "cui/extra-variables.less";
@import (reference) "hue-mixins.less";

.assist-panel {
  .display-flex;
  .flex-direction(column);

  height: 100%;
  overflow: hidden;
  position: relative;

  & > .dz-default {
    display: none;
  }
}

.assist-hidden {
  .flex(0);
}

.assist-panel-contents {
  position: relative;
  .flex(1 1 100%);

  overflow: hidden;
  padding-top: 10px;
}

.assist-function-categories,
.assist-functions {
  list-style: none;
  overflow-x: hidden;
}

.assist-function-categories {
  margin: 5px;
}

.assist-function-categories li {
  line-height: 23px;
}

.assist-function-categories li a i {
  font-size: 12px;
}

.assist-function-categories li a span {
  font-size: 14px;
}

.assist-functions {
  margin: 0;
}

.assist-functions > li {
  margin: 0 0 0 10px;
  padding: 0 0 0 10px;
}

.assist-functions li {
  font-size: 13px;
  line-height: 20px;
}

.assist-functions li div {
  margin: 0 0 0 10px;
  font-style: italic;
}

.assist-function-type-switch {
  padding: 8px 10px;
  font-size: 15px;
}

.side-panel-toggle {
  position: absolute;
  top: 4px;
  margin: 0;
  z-index: 1000;
  color: @cui-gray-400;
  font-size: 16px;
  -webkit-transition: margin 0.2s linear, color 0.5s ease;
  -moz-transition: margin 0.2s linear, color 0.5s ease;
  -ms-transition: margin 0.2s linear, color 0.5s ease;
  transition: margin 0.2s linear, color 0.5s ease;
}

.show-right-side-panel {
  right: 18px;
}

.hide-left-side-panel {
  right: 4px;
}

.show-right-side-panel:hover,
.hide-left-side-panel:hover {
  margin-right: 2px;
  color: @hue-primary-color-dark;
}

.hide-right-side-panel,
.show-left-side-panel {
  left: 4px;
}

.hide-right-side-panel:hover,
.show-left-side-panel:hover {
  margin-left: 2px;
  color: @hue-primary-color-dark;
}

.assist-icon {
  width: 16px;
  height: 16px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  opacity: 0.8;
}

.assist {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.assist-resizer {
  cursor: row-resize;
}

.assist-spinner {
  font-size: 18px;
  height: 23px;
  color: @cui-gray-400;
}

.assist-header {
  .flex(1);

  color: @hue-primary-color-dark;
  background-color: @cui-gray-050;
  border-top: 1px solid @cui-default-border-color;
  border-bottom: 1px solid @cui-default-border-color;
  font-weight: bold;
  letter-spacing: 0.035em;
  font-size: 0.975em;
  line-height: 25px;
  padding-left: 10px;
  height: 24px;
  margin-bottom: 8px;
}

.assist-inner-panel {
  position: absolute;
  overflow: hidden;
  top: 10px;
  right: 0;
  bottom: 2px;
  left: 10px;
}

.assist-inner-header {
  width: 100%;
  color: @cui-gray-700;
  margin-left: 3px;
  margin-bottom: 2px;
  font-weight: bold;
  font-size: 15px;
  margin-top: 0;
}

.assist-stretchable-list {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  border: none;
  padding: 0;
  margin-bottom: 1px;
  margin-top: 3px;
}

.assist-header-actions {
  float: right;
  margin-right: 3px;
  opacity: 0;
}

.assist-header-actions > div {
  cursor: pointer;
}

.assist-panel-switches {
  position: relative;
  .flex(0 0 49px);

  line-height: 49px;
  padding-left: 12px;
  height: 49px;
  border-bottom: 1px solid @cui-default-border-color;
  padding-right: 15px;
}

.assist-type-switch {
  display: inline-block;
  font-size: 20px;
  margin-right: 5px;
  cursor: pointer;
}

.assist-column {
  position: relative;
}

.assist-entry a {
  white-space: nowrap;
}

.assist-file-entry {
  margin-right: 15px;
  border: 1px solid transparent;
}

.assist-file-entry-drop {
  border: 1px solid @hue-primary-color-dark !important;
}

.assist-file-entry-drag {
  display: none;
  position: absolute;
  width: auto;
  text-overflow: ellipsis;
  white-space: nowrap;
  top: -15px;
  left: 10px;
  height: 20px;
  line-height: 20px;
  vertical-align: middle;
  padding: 1px 7px;
  cursor: pointer;
  background-color: @hue-primary-color-dark;
  color: @hue-primary-color-light;
  border-radius: 2px;
  z-index: 1000;
}

.assist-tables {
  margin-left: 0;
}

.assist-tables a {
  text-decoration: none;
}

.assist-tables li {
  list-style: none;
}

.assist-breadcrumb > a:hover {
  color: @hue-primary-color-dark;
}

.assist-errors {
  padding: 4px 5px;
  font-style: italic;
  white-space: normal;
}

.assist-tables > li {
  position: relative;
  padding-top: 2px;
  margin-left: 0;
  margin-right: 0;
  overflow-x: hidden;
}

.assist-tables > li.selected {
  background-color: @cui-gray-200;
}

.assist-tables > li:hover {
  background-color: @cui-gray-050;

  .assist-column {
    background-color: @cui-white;

    .assist-actions,
    .assist-file-actions {
      background-color: @cui-white;
    }

    &:hover {
      background-color: @cui-gray-050;

      .assist-actions,
      .assist-file-actions {
        background-color: @cui-gray-050;
      }
    }
  }

  .assist-actions,
  .assist-file-actions {
    background-color: @cui-gray-050;
  }
}

.assist-breadcrumb {
  padding-top: 0;
  padding-left: 0;
}

.assist-breadcrumb span {
  color: @cui-gray-800;
}

.assist-breadcrumb a:not(.inactive-action) {
  cursor: pointer;
  text-decoration: none;
  color: @cui-gray-800;
  .hue-ease-transition(color);
}

.assist-breadcrumb-text {
  line-height: 16px;
  vertical-align: top;
}

.assist-breadcrumb-back {
  font-size: 15px;
  margin-right: 8px;
}

.assist-document-link .hi {
  font-size: 18px;
}

.assist-table-link {
  font-size: 13px;
}

.assist-field-link {
  font-size: 12px;
}

.right-panel {
  .assist-table-link {
    font-size: 14px;
  }

  .assist-field-link {
    font-size: 13px;
  }
}

.assist-document-link,
.assist-document-link:focus,
.assist-table-link,
.assist-table-link:focus {
  color: @cui-gray-800;
}

.assist-field-link,
.assist-field-link:focus {
  white-space: nowrap;
  color: @cui-gray-700;
}

.assist-field-link-dark,
.assist-field-link-dark:focus {
  color: @cui-gray-800;
}

.assist-db-header-actions {
  position: absolute;
  top: 0;
  right: 0;
  padding-left: 4px;
  padding-right: 13px;
  background-color: @cui-white;

  > a {
    margin-left: 4px;
  }
}

.assist-db-header-actions > * {
  margin-left: 2px;
}

.assist-db-header-actions .dropdown-menu {
  overflow-x: hidden;
  overflow-y: auto;
}

.assist-actions {
  position: absolute;
  top: 0;
  right: 0;
  padding-left: 4px;
  padding-right: 15px;
  background-color: @cui-white;
}

.assist-actions-left {
  left: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  right: inherit !important;
}

.assist-entry-left-action {
  margin-left: 10px;
}

.assist-file-actions {
  position: absolute;
  top: 0;
  right: 0;
  padding-right: 15px;
  padding-left: 4px;
  background-color: @cui-white;
  opacity: 0;

  > a {
    padding: 0 3px;
  }
}

.table-actions {
  padding-top: 2px;
}

.assist-tables > li.selected .assist-actions {
  background-color: @cui-gray-200;
}

.assist-details-wrap {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.assist-details-wrap > div {
  display: table-row;
}

.highlightable {
  -webkit-transition: all 0.6s ease;
  -moz-transition: all 0.6s ease;
  -o-transition: all 0.6s ease;
  transition: all 0.6s ease;
}

.highlight {
  color: @hue-primary-color-dark !important;
  padding-left: 10px;
}

.assist-db-header-actions .highlightable a > span {
  -webkit-transition: all 0.6s ease;
  -moz-transition: all 0.6s ease;
  -o-transition: all 0.6s ease;
  transition: all 0.6s ease;
}

.assist-db-header-actions .highlight {
  padding-left: 0;

  a > span {
    text-shadow: 0 0 0.2em @hue-primary-color-light;
    color: @hue-primary-color-dark !important;
  }
}

.assist-details-header {
  display: table-cell;
  width: 95px;
  font-weight: bold;
}

.assist-details-value {
  display: table-cell;
}

.assist-no-entries {
  color: @cui-gray-600;
  font-style: italic;
  white-space: normal;
}

.assist-flex-panel {
  .display-flex();

  position: relative;
  .flex-flow(column nowrap);
  .flex-align-items(stretch);

  height: 100%;
}

.assist-flex-header {
  overflow: hidden;
  position: relative;
  .flex(0 0 25px);

  white-space: nowrap;
  font-size: 15px;

  &.assist-divider {
    padding-top: 10px;
    border-top: 1px solid @cui-default-border-color;
  }
}

.assist-flex-search {
  overflow: hidden;
  position: relative;
  .flex(0 0 30px);

  white-space: nowrap;
}

.assist-flex-fill,
.assist-flex-half,
.assist-flex-quarter,
.assist-flex-third,
.assist-flex-40,
.assist-flex-60 {
  position: relative;
  white-space: nowrap;
  overflow-x: hidden;
  overflow-y: auto;
  outline: none !important;
}

.assist-docs-topics {
  position: relative;

  > .assist-docs-topic-tree {
    margin-left: 0;
  }
}

.assist-flex-fill {
  .flex(1 1 100%);
}

.assist-flex-half {
  .flex(1 1 50%);
}

.assist-flex-quarter {
  .flex(0 1 25%);
}

.assist-flex-third {
  .flex(0 0 33%);
}

.assist-flex-40 {
  .flex(0 1 40%);
}

.assist-flex-60 {
  .flex(0 1 60%);
}

.database-tree ul {
  margin: 0 !important;
}

.database-tree ul li {
  padding-left: 15px;
}

.function-dialect-dropdown a span {
  color: @cui-gray-800;
  font-size: 14px;
  font-weight: 600;
}

.function-dialect-dropdown a i {
  color: @cui-gray-800;
  font-size: 14px;
}

.assist-filter {
  margin-right: 8px;
}

.assist-filter .inline-autocomp-container {
  height: 25px;
}

.assist-filter input {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  width: 100%;
  height: 25px;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid @input-border;
  box-shadow: none;
}

.assist-docs-topic-tree {
  list-style: none;
  overflow-x: hidden;
  margin: 0 0 0 8px;
}

.assist-function-details,
.assist-docs-details {
  border-top: 2px solid @cui-default-border-color;
  margin-top: 5px;
  margin-right: 10px;
  padding: 10px;
  white-space: normal;
  overflow-x: auto;
}

.context-popover-docs-details {
  padding-top: 2px;

  .hue-doc-title {
    display: none;
  }
}

.context-popover-docs-details,
.assist-docs-details {
  ul li {
    margin: 8px 0;
  }

  .hue-doc-table-hive {
    margin: 10px 0 0 0;
    overflow-x: auto;
    border-collapse: collapse;
  }

  .hue-doc-table-hive thead .hue-doc-td-hive {
    background-color: @cui-gray-050;
  }

  .hue-doc-td-hive,
  .hue-doc-th-hive {
    min-width: 8px;
    border: 1px solid @cui-default-border-color;
    padding: 7px 10px;
    vertical-align: top;
    text-align: left;
  }

  .hue-doc-title-hive {
    color: @hue-primary-color-dark;
  }

  .hue-doc-title {
    color: @hue-primary-color-dark;
    font: 15px/normal @font-family-monospace;
    direction: ltr;
    line-height: 18px;
    margin-bottom: 10px;
  }

  .hue-doc-codeblock,
  .hue-doc-codeph {
    font-family: @font-family-monospace;
    color: @cui-gray-800;
    background: @cui-gray-050;
    border: 1px solid @cui-gray-100;
    border-radius: 2px;
  }

  .hue-doc-codeph {
    padding: 0 3px;
  }

  .hue-doc-codeblock {
    display: block;
    white-space: pre;
    overflow-x: auto;
    margin-bottom: 10px;
    padding: 6px 8px;

    .hue-doc-varname {
      color: @cui-steel;
    }
  }

  .hue-doc-note {
    border: 1px solid @hue-primary-color-light;
    padding: 4px 5px;
    margin-bottom: 10px;

    &::before {
      content: 'Note:';
      color: @cui-gray-800;
      font-weight: 500;
    }
  }

  .hue-doc-note-hive {
    border: 1px solid @hue-primary-color-light;
    border-radius: 4px;
    padding: 0 10px;
    margin: 10px 0 10px 0;

    div {
      margin-top: 10px;
      font-weight: bold;
    }
  }

  .hue-doc-varname {
    font-family: @font-family-monospace;
    font-style: italic;
  }

  //.hue-doc-ph {
  //
  //}

  .hue-doc-filepath {
    font-family: @font-family-monospace;
    color: @cui-gray-800;
  }

  //.hue-doc-external-link {
  //
  //}

  .hue-doc-cmdname {
    font-family: @font-family-monospace;
    color: @cui-steel;
  }

  .hue-doc-term {
    font-family: @font-family-monospace;
  }

  .hue-doc-uicontrol {
    display: inline-block;
    font-weight: 500;
  }

  .hue-doc-example {
    font-family: @font-family-monospace;
    color: @cui-steel;
  }

  //.hue-doc-sthead {
  //
  //}

  .hue-doc-pre {
    display: block;
    font-family: @font-family-monospace;
    white-space: pre-wrap;
    margin-bottom: 10px;
    color: @cui-gray-700;
  }
}

.assist-function-signature {
  font: 15px/normal @font-family-monospace;
  direction: ltr;
  line-height: 18px;
  margin-bottom: 10px;
}

.assist-invalidate-description {
  display: inline-block;
  margin-left: 20px;
  font-style: italic;
  color: @cui-gray-700;
}

.assist-sort {
  padding: 6px 0;
  margin-left: 10px;
}

.popular-color {
  color: @cui-orange-200;
}

.top-star {
  vertical-align: text-top;
  font-size: 70%;
}

.input-spinner {
  background: url(/static/desktop/art/spinner-input.gif) no-repeat right -8px center !important;
}

.assist-panel-close {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 16px;
  height: 16px;
}

.assist-ellipsis {
  .nowrap-ellipsis();
}

.assist-assistant-panel {
  left: 0;

  .assist-flex-panel > div {
    margin-left: 10px;
  }

  .assist-no-entries {
    padding: 5px 10px;
  }

  .statement-count {
    float: right;
    margin-right: 20px;
    font-weight: normal;
    color: @cui-gray-600;
  }

  .col-filter-toggle {
    float: right;
    margin-right: 20px;
  }

  .assist-active-tables {
    list-style: none;
    margin: 0;

    li {
      padding: 0 10px;
      direction: rtl;
      text-align: left;
      .nowrap-ellipsis();
    }
  }
}

.assist-preloader-wrapper {
  background: repeat-y @cui-white;

  .assist-preloader {
    background-color: @cui-white;
  }

  &.assist-preloader-ghost {
    background-image: url(/static/desktop/art/assist-preload.svg);
  }
}
